package com.nbcio.modules.erp.goods.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.nbcio.modules.erp.goods.entity.ErpGoods;
import com.nbcio.modules.erp.goods.entity.ErpGoodsPrice;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;

/**
 * @Description: 商品基础信息
 * @Author: nbacheng
 * @Date:   2023-03-08
 * @Version: V1.0
 */
public interface IErpGoodsService extends IService<ErpGoods> {

	/**
	 * 添加一对多
	 * 
	 */
	public void saveMain(ErpGoods erpGoods,List<ErpGoodsPrice> erpGoodsPriceList) ;
	
	/**
	 * 修改一对多
	 * 
	 */
	public void updateMain(ErpGoods erpGoods,List<ErpGoodsPrice> erpGoodsPriceList);
	
	/**
	 * 删除一对多
	 */
	public void delMain (String id);
	
	/**
	 * 批量删除一对多
	 */
	public void delBatchMain (Collection<? extends Serializable> idList);

	/**
	 * 商品上架
	 */
	public void listing (String id);

	/**
	 * 商品下架
	 */
	public void deListing (String id);

	Map<String, Object> detail(String id);

	List<Map<String, Object>> detailByCategoryId(String categoryId,int page,int size);

	List<Map<String, Object>> queryGoodsByName(String name);

	CompletableFuture<Map<String, Object>> fetchOptimizedDataAsync(String id);

	CompletableFuture<List<Map<String, Object>>> fetchErpGoodsDataAsync(String categoryId, int page, int size);

	List<Map<String, Object>> fetchErpGoodsDataAsync(String name);
}
